package com.jzoffer;

public class MinValueRotatingArray {
    public static void main(String[] args) {
        int[] array = {132};
        int result = minNumberInRotateArray(array);
        System.out.println(result);
    }

    public static int minNumberInRotateArray(int [] array){
        if(array == null || array.length < 1){
            return 0;
        }
//        if(array.length == 1){
//            return array[0];
//        }
        int len = array.length;
        for (int i = 1; i < len ; i++) {
            if(array[i] < array[i - 1]) {
                return array[i];
            }
        }
        return array[0];
    }
}
